package com.miblog.domain;

import org.springframework.data.jpa.domain.AbstractPersistable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToOne;

/**
 * 博客类
 * Created by liuzhengyang on 2015/4/4.
 */

@Entity
public class Blog extends AbstractPersistable<Long>{

    @OneToOne(optional = true, mappedBy = "blog",cascade = CascadeType.ALL)
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
